import { ajax } from '..//tools.js';

function request(path, data = {}, type = 'get') {
  return new Promise(resolve => {
    ajax({
      path,
      data,
      type,
      // dataType: 'json',65
      success: data => {
        resolve(data);
      }
    })
  })
}
const shangxian =location.href.indexOf('mys123.gz01.bdysite.com') === -1 ? 'http://localhost/':'http://mys123.gz01.bdysite.com/'

export const APIGoodsList = data => request(`${shangxian}dewu/php/liebiao.php`, data);

export const APILogina = data => request(`${shangxian}dewu/php/login.php`, data);
export const APIRegister = data => request(`${shangxian}dewu/php/zhuce.php`, data);
export const APIDetail = data => request(`${shangxian}dewu/php/detail.php`, data);
export const APICart = data => request(`${shangxian}dewu/php/cart.php`, data);
export const APICartList = data => request(`${shangxian}dewu/php/cartList.php`, data);
export const APICartUp = data => request(`${shangxian}dewu/php/cartUp.php`, data);
export const APIDelete = data => request(`${shangxian}dewu/php/cartDelete.php`, data);